package io.gitee.chearnee.fw.sidecar.application;

import lombok.RequiredArgsConstructor;
import org.springframework.core.env.Environment;

/**
 * @author cn
 * @version 1.0
 * @description
 * @date 12/19/2022 4:31 PM
 */
@RequiredArgsConstructor
public class ServiceInfo {
    private final Environment environment;
    private String serviceName;

    public String getServiceName() {
        if (serviceName == null) {
            serviceName = environment.getProperty("spring.application.name");
        }
        return serviceName;
    }
}
